package com.webonn.frame.conf;


import com.fasterxml.jackson.annotation.JsonProperty;

import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.datasource.embedded.DataSourceFactory;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
/*@Configuration*/
public class MyConfiguration  {

    private String user_role_sql = "user_role_sql";

    private SMSConfiguration smsConfiguration;

    private JpushConfiguration jpushConfig;

    private SyncRseConfiguration syncRseConfig;

    private String uploadPath;
    @NotEmpty
    private String defaultName = "SKR";

    private boolean useSituation = true;

    private boolean syncRseJobEnable = true;

/*    @Valid
    @NotNull
    private DataSourceFactory database = new DataSourceFactory();*/

    @JsonProperty
    public String getDefaultName() {
        return defaultName;
    }

    @JsonProperty
    public void setDefaultName(String defaultName) {
        this.defaultName = defaultName;
    }

    @JsonProperty("uploadPath")
    public String getUploadPath() {
        return uploadPath;
    }

    @JsonProperty("uploadPath")
    public void setUploadPath(String uploadPath) {
        this.uploadPath = uploadPath;
    }

    /*@JsonProperty("database")
    public DataSourceFactory getDataSourceFactory() {
        return database;
    }

    @JsonProperty("database")
    public void setDataSourceFactory(DataSourceFactory dataSourceFactory) {
        this.database = dataSourceFactory;
    }*/

    @JsonProperty("user_role_sql")
    public String getUser_role_sql() {
        return user_role_sql;
    }

    @JsonProperty("user_role_sql")
    public void setUser_role_sql(String user_role_sql) {
        this.user_role_sql = user_role_sql;
    }

    @JsonProperty("sms")
    public SMSConfiguration getSmsConfiguration() {
        return smsConfiguration;
    }

    @JsonProperty("sms")
    public void setSmsConfiguration(SMSConfiguration smsConfiguration) {
        this.smsConfiguration = smsConfiguration;
    }

    @JsonProperty("jpush")
    public JpushConfiguration getJpushConfig() {
        return jpushConfig;
    }

    @JsonProperty("jpush")
    public void setJpushConfig(JpushConfiguration jpushConfig) {
        this.jpushConfig = jpushConfig;
    }

/*    public DataSourceFactory getDatabase() {
        return database;
    }

    public void setDatabase(DataSourceFactory database) {
        this.database = database;
    }*/

    public boolean isUseSituation() {
        return useSituation;
    }

    public void setUseSituation(boolean useSituation) {
        this.useSituation = useSituation;
    }

    @JsonProperty("syncRse")
    public SyncRseConfiguration getSyncRseConfig() {
        return syncRseConfig;
    }

    @JsonProperty("syncRse")
    public void setSyncRseConfig(SyncRseConfiguration syncRseConfig) {
        this.syncRseConfig = syncRseConfig;
    }

    @JsonProperty
    public boolean isSyncRseJobEnable() {
        return syncRseJobEnable;
    }

    @JsonProperty
    public void setSyncRseJobEnable(boolean syncRseJobEnable) {
        this.syncRseJobEnable = syncRseJobEnable;
    }
}
